Skip to content

Fix potential resource leak in CloudFetchQueue #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

varun-edachali-dbx
Copy link
Collaborator

@varun-edachali-dbx varun-edachali-dbx commented Jul 4, 2025

What type of PR is this?

  • Bug Fix

Description

The ResultFileDownloadManager in the CloudFetchQueue is not shut down alongside the ResultSet.

The ResultFileDownloadManager on being requested for a file ensures that the "download queue is always full", i.e. it adds upto max_download_threads Futures into _download_tasks. In case ResultSet.close() is invoked after this, _shutdown_manager (defined for ResultFileDownloadManager) is NOT called, so these Futures keep executing in the background and the files keep being downloaded.

We define a close for the CloudFetchQueue that invokes _shutdown_manager.

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

N/A

Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
…gardless of server side state

Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Copy link
Contributor

@samikshya-db samikshya-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks for this 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants